package com.socket.demo;

import com.socket.client.ServiceProxyFactory;

public class ClientDemo {
	public static void main(String[] args) {
		ServiceProxyFactory factory = new ServiceProxyFactory();
		final UserService userServiceProxy = (UserService) factory.createProxy(UserService.class);
		
		
		Thread client1 = new Thread(){
			public void run(){
				User user = userServiceProxy.getUser("哈哈", 12);
				System.out.println("User = "+user);
			}
		};
		
		Thread client2 = new Thread(){
			public void run(){
				System.out.println(userServiceProxy.add(1));
			}
		};
		
		Thread client3 = new Thread(){
			public void run(){
				User user = userServiceProxy.getUser("oo", 12);
				System.out.println("User = "+user);
			}
		};
		
		client1.start();
		client2.start();
		client3.start();
	}
}
